![]() |
WOLF core
WOLF: A Modular Estimation Framework for Robotics
|
#include <core/problem/problem.h>
Public Member Functions | |
| virtual | ~Problem () |
| LoaderPtr | getLoader () |
| SizeEigen | getDim () const |
| TypeComposite | getFrameTypes (StateKeys _keys) const |
| void | setTreeManager (TreeManagerBasePtr _gm) |
| TreeManagerBaseConstPtr | getTreeManager () const |
| TreeManagerBasePtr | getTreeManager () |
| HardwareBaseConstPtr | getHardware () const |
| HardwareBasePtr | getHardware () |
| SensorBasePtr | installSensor (YAML::Node _sensor_node, std::vector< std::string > _schema_folders={}) |
| Factory method to install (create and add) sensors only from a YAML node – Helper method loading parameters from file. More... | |
| SensorBasePtr | installSensor (const std::string &_params_yaml_filename, std::vector< std::string > _schema_folders) |
| Factory method to install (create and add) sensors only from its properties – Helper method loading parameters from file. More... | |
| ProcessorBasePtr | installProcessor (YAML::Node _processor_node, std::vector< std::string > _schema_folders={}) |
| Factory method to install (create, and add to sensor) processors only from a YAML node – Helper method loading parameters from file. More... | |
| ProcessorBasePtr | installProcessor (SensorBasePtr _sensor_corresponding, const std::string &_params_yaml_filename, std::vector< std::string > _schema_folders) |
| Factory method to install (create, and add to sensor) processors only from a YAML node – Helper method loading parameters from file. More... | |
| ProcessorBasePtr | installProcessor (const std::string &_params_yaml_filename, std::vector< std::string > _schema_folders) |
| Factory method to install (create, and add to sensor) processors only from its properties. More... | |
| SensorBaseConstPtr | findSensor (const std::string &_sensor_name) const |
| get a sensor pointer by its name More... | |
| SensorBasePtr | findSensor (const std::string &_sensor_name) |
| ProcessorBaseConstPtr | findProcessor (const std::string &_processor_name) const |
| get a processor pointer by its name More... | |
| ProcessorBasePtr | findProcessor (const std::string &_processor_name) |
| std::map< unsigned int, MotionProviderConstPtr > | getMotionProviderMap () const |
| std::map< unsigned int, MotionProviderPtr > | getMotionProviderMap () |
| TrajectoryBaseConstPtr | getTrajectory () const |
| TrajectoryBasePtr | getTrajectory () |
| bool | isFirstFrameSpecified () const |
| bool | isFirstFrameApplied () const |
| void | setFirstFrameOptions (const YAML::Node &_first_frame_node) |
| void | setFirstFrameOptions (const TypeComposite &_first_frame_types, const VectorComposite &_first_frame_values, const PriorComposite &_first_frame_priors) |
| FrameBasePtr | applyFirstFrameOptions (const TimeStamp &_ts) |
| FrameBasePtr | emplaceFirstFrame (const TimeStamp &_ts, const YAML::Node &_first_frame_node) |
| FrameBasePtr | emplaceFirstFrame (const TimeStamp &_ts, const TypeComposite &_first_frame_types, const VectorComposite &_first_frame_values, const PriorComposite &_first_frame_priors) |
| FrameBasePtr | emplaceFrame (const TimeStamp &_time_stamp, const TypeComposite &_frame_types, const VectorComposite &_frame_state, const PriorComposite &_frame_priors={}) |
| Emplace frame from timestamp, types and and state. More... | |
| FrameBasePtr | emplaceFrame (const TimeStamp &_time_stamp, const StateKeys &_frame_keys) |
| Emplace frame from timestamp and keys. More... | |
| FrameBasePtr | emplaceFrame (const TimeStamp &_time_stamp, const VectorComposite &_frame_state) |
| Emplace frame from timestamps and state. More... | |
| FrameBasePtr | emplaceFrame (const TimeStamp &_time_stamp, const StateKeys &_frame_keys, const Eigen::VectorXd &_frame_state) |
| Emplace frame from timestamp and state vector. More... | |
| void | emplaceStatesToFrame (FrameBasePtr _frame_ptr, const StateKeys &_frame_keys) |
| Take a frame and emplace to it the missing states with the frame timestamp. More... | |
| void | emplaceStatesToFrame (FrameBasePtr _frame_ptr, const VectorComposite &_frame_states) |
| Take a frame and emplace to it the missing states. More... | |
| FrameBaseConstPtr | getLastFrame () const |
| FrameBasePtr | getLastFrame () |
| FrameBaseConstPtr | closestFrameToTimeStamp (const TimeStamp &_ts) const |
| FrameBasePtr | closestFrameToTimeStamp (const TimeStamp &_ts) |
| bool | permitKeyFrame (ProcessorBaseConstPtr _processor_ptr) const |
| Give the permission to a processor to create a new key Frame. More... | |
| void | keyFrameCallback (FrameBasePtr _keyframe_ptr, ProcessorBasePtr _processor_ptr) |
| New key frame callback. More... | |
| TimeStamp | getTimeStamp () const |
| VectorComposite | getState (const StateKeys &_keys) const |
| VectorComposite | getState (const TimeStamp &_ts, const StateKeys &_keys) const |
| VectorComposite | getOdometry (const StateKeys &_keys) const |
| VectorComposite | stateZero (TypeComposite _types) const |
| VectorComposite | stateZero (const StateKeys &_keys) const |
| MapBaseConstPtr | getMap () const |
| MapBasePtr | getMap () |
| void | setMap (MapBasePtr) |
| bool | saveMap (const std::string &_filename_dot_yaml, const std::string &_map_name="Map automatically saved by Wolf") |
| void | perturb (double amplitude=0.01) |
| perturb all states states with random noise following an uniform distribution in [ -amplitude, amplitude ] More... | |
| void | transform (const VectorComposite &_transformation) |
| bool | isTransformed () const |
| void | resetTransformed () |
| VectorComposite | getTransformation () const |
| void | clearCovariance () |
| void | addCovarianceBlock (StateBlockPtr _state1, StateBlockPtr _state2, const Eigen::MatrixXd &_cov) |
| void | addCovarianceBlock (StateBlockPtr _state1, const Eigen::MatrixXd &_cov) |
| bool | getCovarianceBlock (StateBlockConstPtr _state1, StateBlockConstPtr _state2, Eigen::MatrixXd &_cov, const int _row=0, const int _col=0) const |
| bool | getCovarianceBlock (std::map< StateBlockConstPtr, unsigned int > _sb_2_idx, Eigen::MatrixXd &_cov) const |
| bool | getCovarianceBlock (StateBlockConstPtr _state, Eigen::MatrixXd &_cov, const int _row_and_col=0) const |
| bool | getCovariance (NodeStateBlocksConstPtr _has_states_ptr, const StateKeys &_keys, Eigen::MatrixXd &_covariance) const |
| bool | getLastFrameCovariance (const StateKeys &_keys, Eigen::MatrixXd &_covariance) const |
| StateBlockPtr | notifyStateBlock (StateBlockPtr _state_ptr, Notification _notif) |
| Notifies a new/removed state block to update the solver manager. More... | |
| SizeStd | getStateBlockNotificationMapSize () const |
| Returns the size of the map of state block notification. More... | |
| bool | getStateBlockNotification (const StateBlockPtr &sb_ptr, Notification ¬if) const |
| Returns if the state block has been notified, and the notification via parameter. More... | |
| FactorBasePtr | notifyFactor (FactorBasePtr _factor_ptr, Notification _notif) |
| Notifies a new/removed factor to update the solver manager. More... | |
| SizeStd | getFactorNotificationMapSize () const |
| Returns the size of the map of factor notification. More... | |
| bool | getFactorNotification (const FactorBasePtr &fac_ptr, Notification ¬if) const |
| Returns if the factor has been notified, and the notification via parameter. More... | |
| void | print (int depth=4, bool factored_by=false, bool metric=true, bool state_blocks=false, std::ostream &stream=std::cout) const |
| print wolf tree More... | |
| bool | check (int verbose_level=0) const |
| bool | check (bool verbose, std::ostream &stream) const |
Static Public Member Functions | |
| static ProblemPtr | create (SizeEigen _dim, const TypeComposite &_frame_types={}, LoaderPtr _loader=nullptr) |
| static ProblemPtr | autoSetup (const std::string &_input_yaml_file, std::vector< std::string > _primary_schema_folders={}, LoaderPtr _loader=nullptr, bool _skip_yaml_validation=false) |
| static ProblemPtr | autoSetup (YAML::Node _param_node, std::vector< std::string > _primary_schema_folders={}, LoaderPtr _loader=nullptr, bool _skip_yaml_validation=false) |
Protected Member Functions | |
| void | addFrameTypes (const TypeComposite &_types) |
| void | addMotionProvider (MotionProviderPtr _processor_motion_ptr) |
| Set the processor motion. More... | |
| void | removeMotionProvider (MotionProviderPtr proc) |
| void | consumeNotifications (std::map< StateBlockPtr, Notification > &, std::map< FactorBasePtr, Notification > &) |
| Returns the map of state block notification to be handled by the solver (the map stored in this is emptied) More... | |
| std::map< StateBlockPtr, Notification > | consumeStateBlockNotificationMap () |
| Returns the map of state block notification to be handled by the solver (the map stored in this is emptied) More... | |
| std::map< FactorBasePtr, Notification > | consumeFactorNotificationMap () |
| Returns the map of factor notification to be handled by the solver (the map stored in this is emptied) More... | |
Protected Attributes | |
| HardwareBasePtr | hardware_ptr_ |
| TrajectoryBasePtr | trajectory_ptr_ |
| MapBasePtr | map_ptr_ |
| TreeManagerBasePtr | tree_manager_ |
| std::map< unsigned int, MotionProviderPtr > | motion_provider_map_ |
| SizeEigen | dim_ |
| TypeComposite | frame_types_ |
| VectorComposite | first_frame_values_ |
| PriorComposite | first_frame_priors_ |
| unsigned int | first_frame_status_ |
| 0: not set, 1: set, 2: applied More... | |
| std::map< std::pair< StateBlockConstPtr, StateBlockConstPtr >, Eigen::MatrixXd > | covariances_ |
| std::map< FactorBasePtr, Notification > | factor_notification_map_ |
| std::map< StateBlockPtr, Notification > | state_block_notification_map_ |
| std::mutex | mut_notifications_ |
| std::mutex | mut_covariances_ |
| std::atomic_bool | transformed_ |
| VectorComposite | transformation_ |
| std::mutex | mut_transform_ |
| LoaderPtr | loader_ |
|
virtual |
| void wolf::Problem::addCovarianceBlock | ( | StateBlockPtr | _state1, |
| const Eigen::MatrixXd & | _cov | ||
| ) |
| void wolf::Problem::addCovarianceBlock | ( | StateBlockPtr | _state1, |
| StateBlockPtr | _state2, | ||
| const Eigen::MatrixXd & | _cov | ||
| ) |
|
protected |
|
protected |
Set the processor motion.
Add a new processor of type is motion to the processor is motion list.
| FrameBasePtr wolf::Problem::applyFirstFrameOptions | ( | const TimeStamp & | _ts | ) |
|
static |
|
static |
| bool wolf::Problem::check | ( | bool | verbose, |
| std::ostream & | stream | ||
| ) | const |
| bool wolf::Problem::check | ( | int | verbose_level = 0 | ) | const |
| void wolf::Problem::clearCovariance | ( | ) |
| FrameBasePtr wolf::Problem::closestFrameToTimeStamp | ( | const TimeStamp & | _ts | ) |
| FrameBaseConstPtr wolf::Problem::closestFrameToTimeStamp | ( | const TimeStamp & | _ts | ) | const |
|
protected |
Returns the map of factor notification to be handled by the solver (the map stored in this is emptied)
|
inlineprotected |
Returns the map of state block notification to be handled by the solver (the map stored in this is emptied)
|
protected |
Returns the map of state block notification to be handled by the solver (the map stored in this is emptied)
|
static |
| FrameBasePtr wolf::Problem::emplaceFirstFrame | ( | const TimeStamp & | _ts, |
| const TypeComposite & | _first_frame_types, | ||
| const VectorComposite & | _first_frame_values, | ||
| const PriorComposite & | _first_frame_priors | ||
| ) |
| FrameBasePtr wolf::Problem::emplaceFirstFrame | ( | const TimeStamp & | _ts, |
| const YAML::Node & | _first_frame_node | ||
| ) |
| FrameBasePtr wolf::Problem::emplaceFrame | ( | const TimeStamp & | _time_stamp, |
| const StateKeys & | _frame_keys | ||
| ) |
Emplace frame from timestamp and keys.
| _time_stamp | Time stamp of the frame |
| _frame_keys | String containing the keys of the desired frame. Empty means all keys available. |
This acts as a Frame factory, but also takes care to update related lists in WolfProblem:
| FrameBasePtr wolf::Problem::emplaceFrame | ( | const TimeStamp & | _time_stamp, |
| const StateKeys & | _frame_keys, | ||
| const Eigen::VectorXd & | _frame_state | ||
| ) |
Emplace frame from timestamp and state vector.
| _time_stamp | Time stamp of the frame |
| _frame_keys | String containing the keys of the desired frame. Empty means all keys available. |
| _frame_state | State vector; must match the size and format of the chosen frame state_keys |
This acts as a Frame factory, but also takes care to update related lists in WolfProblem:
| FrameBasePtr wolf::Problem::emplaceFrame | ( | const TimeStamp & | _time_stamp, |
| const TypeComposite & | _frame_types, | ||
| const VectorComposite & | _frame_state, | ||
| const PriorComposite & | _frame_priors = {} |
||
| ) |
Emplace frame from timestamp, types and and state.
| _time_stamp | Time stamp of the frame |
| _frame_types | TypeComposite indicating the types of each key. |
| _frame_state | VectorComposite with the states |
| _frame_priors | PriorComposite with the priors on the states (not all keys required) |
This acts as a Frame factory, but also takes care to update related lists in WolfProblem:
| FrameBasePtr wolf::Problem::emplaceFrame | ( | const TimeStamp & | _time_stamp, |
| const VectorComposite & | _frame_state | ||
| ) |
Emplace frame from timestamps and state.
| _time_stamp | Time stamp of the frame |
| _frame_state | State; must be part of the problem's frame state_keys |
This acts as a Frame factory, but also takes care to update related lists in WolfProblem:
| void wolf::Problem::emplaceStatesToFrame | ( | FrameBasePtr | _frame_ptr, |
| const StateKeys & | _frame_keys | ||
| ) |
Take a frame and emplace to it the missing states with the frame timestamp.
| _frame_ptr | Frame to which states have to be emplaced |
| _frame_keys | the keys that the frame is requested to have. |
| void wolf::Problem::emplaceStatesToFrame | ( | FrameBasePtr | _frame_ptr, |
| const VectorComposite & | _frame_states | ||
| ) |
Take a frame and emplace to it the missing states.
| _frame_ptr | Frame to which states have to be emplaced |
| _frame_states | the states vectors to be added to the frame |
| ProcessorBasePtr wolf::Problem::findProcessor | ( | const std::string & | _processor_name | ) |
| ProcessorBaseConstPtr wolf::Problem::findProcessor | ( | const std::string & | _processor_name | ) | const |
get a processor pointer by its name
| _processor_name | The processor name, as it was installed with installProcessor() |
| SensorBasePtr wolf::Problem::findSensor | ( | const std::string & | _sensor_name | ) |
| SensorBaseConstPtr wolf::Problem::findSensor | ( | const std::string & | _sensor_name | ) | const |
get a sensor pointer by its name
| _sensor_name | The sensor name, as it was installed with installSensor() |
| bool wolf::Problem::getCovariance | ( | NodeStateBlocksConstPtr | _has_states_ptr, |
| const StateKeys & | _keys, | ||
| Eigen::MatrixXd & | _covariance | ||
| ) | const |
| bool wolf::Problem::getCovarianceBlock | ( | StateBlockConstPtr | _state, |
| Eigen::MatrixXd & | _cov, | ||
| const int | _row_and_col = 0 |
||
| ) | const |
| bool wolf::Problem::getCovarianceBlock | ( | StateBlockConstPtr | _state1, |
| StateBlockConstPtr | _state2, | ||
| Eigen::MatrixXd & | _cov, | ||
| const int | _row = 0, |
||
| const int | _col = 0 |
||
| ) | const |
| bool wolf::Problem::getCovarianceBlock | ( | std::map< StateBlockConstPtr, unsigned int > | _sb_2_idx, |
| Eigen::MatrixXd & | _cov | ||
| ) | const |
| SizeEigen wolf::Problem::getDim | ( | ) | const |
| bool wolf::Problem::getFactorNotification | ( | const FactorBasePtr & | fac_ptr, |
| Notification & | notif | ||
| ) | const |
Returns if the factor has been notified, and the notification via parameter.
|
inline |
Returns the size of the map of factor notification.
| TypeComposite wolf::Problem::getFrameTypes | ( | StateKeys | _keys | ) | const |
| HardwareBasePtr wolf::Problem::getHardware | ( | ) |
| HardwareBaseConstPtr wolf::Problem::getHardware | ( | ) | const |
| FrameBasePtr wolf::Problem::getLastFrame | ( | ) |
| FrameBaseConstPtr wolf::Problem::getLastFrame | ( | ) | const |
| bool wolf::Problem::getLastFrameCovariance | ( | const StateKeys & | _keys, |
| Eigen::MatrixXd & | _covariance | ||
| ) | const |
|
inline |
| MapBasePtr wolf::Problem::getMap | ( | ) |
| MapBaseConstPtr wolf::Problem::getMap | ( | ) | const |
|
inline |
|
inline |
| VectorComposite wolf::Problem::getOdometry | ( | const StateKeys & | _keys | ) | const |
| VectorComposite wolf::Problem::getState | ( | const StateKeys & | _keys | ) | const |
| VectorComposite wolf::Problem::getState | ( | const TimeStamp & | _ts, |
| const StateKeys & | _keys | ||
| ) | const |
| bool wolf::Problem::getStateBlockNotification | ( | const StateBlockPtr & | sb_ptr, |
| Notification & | notif | ||
| ) | const |
Returns if the state block has been notified, and the notification via parameter.
|
inline |
Returns the size of the map of state block notification.
| TimeStamp wolf::Problem::getTimeStamp | ( | ) | const |
| TrajectoryBasePtr wolf::Problem::getTrajectory | ( | ) |
| TrajectoryBaseConstPtr wolf::Problem::getTrajectory | ( | ) | const |
| VectorComposite wolf::Problem::getTransformation | ( | ) | const |
|
inline |
|
inline |
| ProcessorBasePtr wolf::Problem::installProcessor | ( | const std::string & | _params_yaml_filename, |
| std::vector< std::string > | _schema_folders | ||
| ) |
Factory method to install (create, and add to sensor) processors only from its properties.
This method creates a Processor, and adds it to the specified sensor's list of processors
This method is a helper wrapper around the version accepting a sensor pointer instead of a sensor name.
| _params_yaml_filename | name of formatted yaml file defining the processor parameters. |
| _schema_folders | a vector of paths where the schema files (to validate the YAML file) are placed |
| ProcessorBasePtr wolf::Problem::installProcessor | ( | SensorBasePtr | _sensor_corresponding, |
| const std::string & | _params_yaml_filename, | ||
| std::vector< std::string > | _schema_folders | ||
| ) |
Factory method to install (create, and add to sensor) processors only from a YAML node – Helper method loading parameters from file.
| _sensor_corresponding | corresponding sensor pointer, used to bind the processor to the particular instance of the sensor |
| _params_yaml_filename | name of formatted yaml file defining the processor parameters. |
| _schema_folders | a vector of paths where the schema files (to validate the YAML node) are placed, if empty the node is not validated. |
| ProcessorBasePtr wolf::Problem::installProcessor | ( | YAML::Node | _processor_node, |
| std::vector< std::string > | _schema_folders = {} |
||
| ) |
| SensorBasePtr wolf::Problem::installSensor | ( | const std::string & | _params_yaml_filename, |
| std::vector< std::string > | _schema_folders | ||
| ) |
Factory method to install (create and add) sensors only from its properties – Helper method loading parameters from file.
| _params_yaml_filename | the name of a file containing the parameters in a format compatible with the intrinsics creator registered in FactoryParamsSensor under the key _sen_type. |
| _schema_folders | a vector of paths where the schema files (to validate the YAML file) are placed |
| SensorBasePtr wolf::Problem::installSensor | ( | YAML::Node | _sensor_node, |
| std::vector< std::string > | _schema_folders = {} |
||
| ) |
|
inline |
|
inline |
| bool wolf::Problem::isTransformed | ( | ) | const |
| void wolf::Problem::keyFrameCallback | ( | FrameBasePtr | _keyframe_ptr, |
| ProcessorBasePtr | _processor_ptr | ||
| ) |
New key frame callback.
New key frame callback: It should be called by any processor that creates a new key frame. It calls the keyFrameCallback of the rest of processors.
| FactorBasePtr wolf::Problem::notifyFactor | ( | FactorBasePtr | _factor_ptr, |
| Notification | _notif | ||
| ) |
Notifies a new/removed factor to update the solver manager.
| StateBlockPtr wolf::Problem::notifyStateBlock | ( | StateBlockPtr | _state_ptr, |
| Notification | _notif | ||
| ) |
Notifies a new/removed state block to update the solver manager.
| bool wolf::Problem::permitKeyFrame | ( | ProcessorBaseConstPtr | _processor_ptr | ) | const |
Give the permission to a processor to create a new key Frame.
This should implement a black list of processors that have forbidden key frame creation.
| void wolf::Problem::perturb | ( | double | amplitude = 0.01 | ) |
perturb all states states with random noise following an uniform distribution in [ -amplitude, amplitude ]
| void wolf::Problem::print | ( | int | depth = 4, |
| bool | factored_by = false, |
||
| bool | metric = true, |
||
| bool | state_blocks = false, |
||
| std::ostream & | stream = std::cout |
||
| ) | const |
print wolf tree
| depth | : levels to show ( 0: H, T, M : 1: H:S, T:F, M:L ; 2: H:S:p, T:F:C ; 3: T:F:C:f ; 4: T:F:C:f:c ) |
| factored_by | : show factors pointing to F, C, f and L. |
| metric | : show metric info (status, time stamps, state vectors, measurements) |
| state_blocks | : show state blocks |
|
protected |
| void wolf::Problem::resetTransformed | ( | ) |
| bool wolf::Problem::saveMap | ( | const std::string & | _filename_dot_yaml, |
| const std::string & | _map_name = "Map automatically saved by Wolf" |
||
| ) |
| void wolf::Problem::setFirstFrameOptions | ( | const TypeComposite & | _first_frame_types, |
| const VectorComposite & | _first_frame_values, | ||
| const PriorComposite & | _first_frame_priors | ||
| ) |
| void wolf::Problem::setFirstFrameOptions | ( | const YAML::Node & | _first_frame_node | ) |
| void wolf::Problem::setMap | ( | MapBasePtr | _map_ptr | ) |
| void wolf::Problem::setTreeManager | ( | TreeManagerBasePtr | _gm | ) |
| VectorComposite wolf::Problem::stateZero | ( | const StateKeys & | _keys | ) | const |
| VectorComposite wolf::Problem::stateZero | ( | TypeComposite | _types | ) | const |
| void wolf::Problem::transform | ( | const VectorComposite & | _transformation | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
0: not set, 1: set, 2: applied
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |